<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="UTF-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script type="module" src="./index.js"></script>
    <!-- <script>
      class DoblyNode {
        constructor(data) {
          this.element = data;
          this.previous = null;
          this.next = null;
        }
      }

      class DoublyList {
        /**
         * 头节点
         */
        #head = null;
        /**
         * 尾节点
         */
        #tail = null;
        /**
         * 链表长度
         */
        #count = 0;

        /**
         * 向链表尾部添加元素
         * @param {any} data
         * @returns true | false
         */
        push(data) {
          const node = new DoblyNode(data);
          if (this.#head === null) {
            this.#head = node;
            this.#tail = node;
          } else {
            this.#tail.next = node;
            node.previous = this.#tail;
            this.#tail = node;
          }

          this.#count++;
          return true;
        }
      }

      const list = new DoublyList()
      list.push('1')
      list.push('2')
      list.push('3')
      list.push('4')
      list.push('5')
    </script> -->
  </body>
</html>
